#!/usr/bin/expect
spawn scp /etc/fstab root@192.168.56.101:/root
expect {
     "yes/no" { send "yes\n";exp_continue }
     "password" { send "root\n" }
}
expect eof